package com.qf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.pojo.DtsOrder;
import com.qf.vo.DtsOrderVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author zhaojian
 * @since 2021-05-12
 */
public interface DtsOrderMapper extends BaseMapper<DtsOrder> {


    @Select("select date_format(t.add_time,\"%Y-%m-%d\") as day,count(1) as orders,\n" +
            "sum(settlement_money) as amount,count(DISTINCT user_id) as customers,\n" +
            "avg(settlement_money) as pcr\n" +
            "from dts_order t\n" +
            "group by date_format(t.add_time,\"%Y-%m-%d\")")
    List<DtsOrderVo> selectOrderList();
}
